package com.thememaker.util;

import com.thememake.Constants;
import com.thememake.annotation.Group;
import com.thememake.entity.ThemeFileInfo;
import com.thememake.entity.User;

import static com.thememake.Constants.VIP100;

/**
 * Created by jiajun.jiang on 2018/3/12.
 */
public class VipControllerUtils {
    private static VipControllerUtils vipControllerUtils;
    private ThemeFileInfo themeFileInfo;
    private VipControllerUtils(){}

    public ThemeFileInfo getThemeFileInfo() {
        return themeFileInfo;
    }

    public void setThemeFileInfo(ThemeFileInfo themeFileInfo) {
        this.themeFileInfo = themeFileInfo;
    }

    public static VipControllerUtils getInstance(ThemeFileInfo themeFileInfo){
        if (vipControllerUtils == null){
            vipControllerUtils = new VipControllerUtils();
        }
        vipControllerUtils.setThemeFileInfo(themeFileInfo);
        return vipControllerUtils;
    }

    public boolean canShowBatchExport(){
        User user = themeFileInfo.getUser();
        if (user.getVipRank() == VIP100){
            return true;
        }
        return false;
    }

    public boolean canUserDialerPsd(Group group){
        if ("dialer".equals(group.name())){
            User user = themeFileInfo.getUser();
            if (user.getVipRank() == VIP100){
                return true;
            }
            return false;
        }
        return true;
    }

    public boolean canShowMoreModel(){
        User user = themeFileInfo.getUser();
        if (user.getVipRank() == VIP100){
            if (themeFileInfo.getThemeType().equals(Constants.VIVO)){
                return true;
            }
        }
        return false;
    }

    public static boolean canShowModelList(User user){
        if (user.getVipRank() == VIP100){
            return true;
        }
        return false;
    }

    public boolean canUseLockscreenPsd(){
        User user = themeFileInfo.getUser();
        if (user.getVipRank() == VIP100){
            return true;
        }
        return false;
    }



    public boolean canShowMenuItemThemeZip(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }

    public boolean canShowMenuItemThemeUnZip(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }


    public boolean canShowMenuItemThemeColour(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }

    public boolean canShowMenuItemThemeBackground(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }


    public boolean canShowIconMake(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }


    public boolean canShowBatteryMake(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }



    public boolean canShowFontMake(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }



    public boolean canShowBorderMake(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }



    public boolean canShowOuterglowMake(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }

    public boolean canShowGradient(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }


    public boolean canShowMultiwindow(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }


    public boolean canShowEditItem(){
        User user = themeFileInfo.getUser();
        if(user!=null){
            if (user.getVipRank() == VIP100){
                return true;
            }
        }
        return false;
    }


}
